package com.fxm.client;

import com.fxm.config.feign.AnswerFeignConfig;
import com.fxm.returns.RespEntity;
import com.fxm.returns.RespTable;
import com.fxm.vo.param.AnswerParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author fxm
 * @version V1.0.0
 * @description: 答案管理 feign调用
 * @date 2021/02/22 11:22
 */
@FeignClient(name = "answerFeignClient", url = "${manage.url}", configuration = AnswerFeignConfig.class)
public interface AnswerClient {
    /**
     * 答案列表
     * @param page
     * @param limit
     * @return
     */
    @GetMapping("/answer/list")
    RespTable answerList(@RequestParam("page") Integer page,
                         @RequestParam("limit") Integer limit);

    /**
     * 搜索题目
     * @param page
     * @param limit
     * @param questionTitle
     * @return
     */
    @GetMapping("/answer/list")
    RespTable searchAnswer(@RequestParam("page") Integer page,
                           @RequestParam("limit") Integer limit,
                           @RequestParam("questionTitle") String questionTitle);

    /**
     * 查询题目选项
     * @param id
     * @return
     */
    @GetMapping("/answer/queryOption")
    RespEntity queryOption(@RequestParam("id") Integer id);

    /**
     * 编辑答案
     * @param answerParam
     * @return
     */
    @PutMapping("/answer/update")
    RespEntity updateAnswer(@RequestBody AnswerParam answerParam);

}
